/**
 * 校验IP
 */
export const validatorIp = (value: string) => {
  return /^(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$/.test(
    value,
  );
};

/**
 * 校验域名
 */
export const validatorDomain = (host: string) => {
  return /^([0-9a-zA-Z-]{1,}\.)+([a-zA-Z]{2,})$/.test(host);
};
